import type { AppRouteRecordRaw } from '@/router/types';
import { t } from '@/hooks/web/useI18n';
import {
  REDIRECT_NAME,
  LAYOUT,
  EXCEPTION_COMPONENT,
  PAGE_NOT_FOUND_NAME,
} from '@/router/constant';
// 404 on a page
export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
  path: '/:path(.*)*',
  name: PAGE_NOT_FOUND_NAME,
  component: LAYOUT,
  meta: {
    title: 'ErrorPage',
    hideBreadcrumb: true,
    hideMenu: true,
  }
};

export const REDIRECT_ROUTE: AppRouteRecordRaw = {
  path: '/redirect',
  component: LAYOUT,
  name: 'RedirectTo',
  meta: {
    title: REDIRECT_NAME,
    hideBreadcrumb: true,
    hideMenu: true,
  },
  children: [
    {
      path: '/redirect/:path(.*)',
      name: REDIRECT_NAME,
      component: () => import('@/views/sys/redirect/index.vue'),
      meta: {
        title: REDIRECT_NAME,
        hideBreadcrumb: true,
      },
    },
  ],
};

export const ERROR_LOG_ROUTE: AppRouteRecordRaw = {
  path: '/error-log',
  name: 'ErrorLog',
  component: LAYOUT,
  redirect: '/error-log/list',
  meta: {
    title: 'ErrorLog',
    hideBreadcrumb: true,
    hideChildrenInMenu: true,
  },
  children: [
    {
      path: 'list',
      name: 'ErrorLogList',
      component: () => import('@/views/sys/error-log/index.vue'),
      meta: {
        title: t('routes.basic.errorLogList'),
        hideBreadcrumb: true,
        currentActiveMenu: '/error-log',
      },
    },
  ],
};
export const CAR_TEAM_ROUTE: AppRouteRecordRaw = {
  path: '/carteam',
  name: 'CarTeam',
  component: LAYOUT,
  meta: {
    title: '车队管理',
    hideBreadcrumb: true,
    hideChildrenInMenu: true,
  },
  children: [
    {
      path: 'teamlist',
      name: 'carTeamList',
      component: () => import('@/views/admin/company/carTeamList.vue'),
      meta: {
        title: '车队管理',
        hideBreadcrumb: true,
      },
    },
  ],
};
export const CAR_ROUTE: AppRouteRecordRaw = {
  path: '/car',
  name: 'Car',
  component: LAYOUT,
  meta: {
    title: '车辆管理',
    hideBreadcrumb: true,
    hideChildrenInMenu: true,
  },
  children: [
    {
      path: 'list',
      name: 'carList',
      component: () => import('@/views/admin/company/carList.vue'),
      meta: {
        title: '车辆管理',
        hideBreadcrumb: true,
      },
    },
  ],
};
export const ADMIN_ROUTE: AppRouteRecordRaw = {
  path: '/operate',
  name: 'AdminManage',
  component: LAYOUT,
  meta: {
    title: '管理员管理',
    hideBreadcrumb: true,
    hideChildrenInMenu: true,
  },
  children: [
    {
      path: 'adminlist',
      name: 'adminlist',
      component: () => import('@/views/admin/company/adminList.vue'),
      meta: {
        title: '管理员管理',
        hideBreadcrumb: true,
      },
    },
  ],
};
// 充电桩列表
export const PILE_LIST: AppRouteRecordRaw = {
  path: '/pile',
  name: 'PileList',
  component: LAYOUT,
  meta: {
    title: '充电桩管理',
    hideBreadcrumb: true,
    hideChildrenInMenu: true,
  },
  children: [
    {
      path: 'list',
      name: 'pileList',
      component: () => import('@/views/admin/pile/list.vue'),
      meta: {
        title: '充电桩管理',
        hideBreadcrumb: true,
      },
    },
  ],
};

